<template>
  <Card>
    <Form ref="loanInfoForm" :model="loanInfoForm" :rules="loanInfoFormRules" :label-width="120" inline>
      <Collapse value="1">
        <Panel name="1">
          贷款信息
          <p slot="content">

            <Row>
              <Col span="12">
              <FormItem label="申请金额" prop="principalAmt">
                <Input v-model="loanInfoForm.principalAmt" placeholder="" disabled>
                </Input>
              </FormItem>
              </Col>
              <Col span="12">
              <FormItem label="申请期数" prop="applyTerms">
                <Input v-model="loanInfoForm.applyTerms" placeholder="" disabled>
                </Input>
              </FormItem>
              </Col>
            </Row>
            <Row>
              <Col span="12">
              <FormItem label="申请产品" prop="productName">
                <Input v-model="loanInfoForm.productName" placeholder="" disabled>
                </Input>
              </FormItem>
              </Col>
              <Col span="12">
              <FormItem label="产品代码" prop="productCode">
                <Input v-model="loanInfoForm.productCode" placeholder="" disabled>
                </Input>
              </FormItem>
              </Col>
            </Row>
            <Row>
              <Col span="12">
              <FormItem label="借款用途" prop="purposeCode">
                <Select :disabled="taskParams.type!=1" v-model="loanInfoForm.purposeCode" class="task-process-detail-select">
                  <Option v-for="item in selectPurposeData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                </Select>
              </FormItem>
              </Col>
              <Col span="12">

              </Col>
            </Row>
            <Row>
              <div align="center" v-if="(taskParams.isModal==false && loanInfoForm.productType!=='4')">
                <Button type="primary" @click="submitForm">保存</Button>
              </div>
            </Row>
          </p>
        </Panel>
      </Collapse>
      <br>
      <Collapse value="1" v-if="loanInfoForm.productType==='4' || loanInfoForm.productType==='18'">
        <Panel name="1">
          房产信息
          <p slot="content">
            <Table :columns="columns3" :data="estateData"></Table>
            <Button type="primary" icon="md-add" @click="addEstateDefaultEmptyRow" v-if="taskParams.isModal==false" style="margin-top:5px;"></Button>
          </p>
        </Panel>
      </Collapse>
      <br>
      <Collapse value="1" v-if="(loanInfoForm.productType==='1'&& insurancePolicy1.insuranceId!=null && insurancePolicy1.insuranceId!='')">
        <Panel name="1">
          录音文件
          <p slot="content">
            <Table :columns="columns2" :data="recordingData"></Table>
          </p>
        </Panel>
      </Collapse>
      <br>
      <Collapse value="1" v-if="loanInfoForm.productType==1 || loanInfoForm.productType==17">
        <Panel name="1">
          保单信息
          <p slot="content">
            <Form ref="insurancePolicy1" :model="insurancePolicy1" :rules="insurancePolicy1Rule" :label-width="90" inline>
              <Row>
                <Col span="12">
                <Row>
                  <Col span="24">
                  <FormItem label="保险公司" prop="insuranceCpyCode">
                    <Select :disabled="taskParams.type!=1" v-model="insurancePolicy1.insuranceCpyCode" class="task-process-detail-select">
                      <Option v-for="item in selectInsuranceCpyData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                    </Select>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="保单号" prop="insuranceNum">
                    <Input :disabled="taskParams.type!=1" v-model="insurancePolicy1.insuranceNum" placeholder="">
                    </Input>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="主险名称" prop="insuranceName">
                    <Input :disabled="taskParams.type!=1" v-model="insurancePolicy1.insuranceName" placeholder="">
                    </Input>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="保单类型" prop="insuranceType">
                    <Select :disabled="taskParams.type!=1" v-model="insurancePolicy1.insuranceType" class="task-process-detail-select">
                      <Option v-for="item in selectInsuranceTypeData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                    </Select>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="寿险类型" prop="lifeInsuranceType">
                    <Select :disabled="taskParams.type!=1" v-model="insurancePolicy1.lifeInsuranceType" class="task-process-detail-select">
                      <Option v-for="item in selectLifeInsuranceTypeData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                    </Select>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="保单生效日" prop="insuranceEftDate">
                    <DatePicker :disabled="taskParams.type!=1" v-model="insurancePolicy1.insuranceEftDate" :value="insurancePolicy1.insuranceEftDate" type="date" placeholder=""></DatePicker>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="保费总额" prop="insuranceAmount">
                    <Input :disabled="taskParams.type!=1" v-model="insurancePolicy1.insuranceAmount" placeholder="">
                    </Input>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="保单状态" prop="insuranceStatus">
                    <Select :disabled="taskParams.type!=1" v-model="insurancePolicy1.insuranceStatus" class="task-process-detail-select">
                      <Option v-for="item in selectInsuranceStatusData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                    </Select>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="投保年限" prop="insuranceYears">
                    <Input :disabled="taskParams.type!=1" v-model="insurancePolicy1.insuranceYears" placeholder="">
                    </Input>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="附加险数量" prop="additionalInsuranceNum">
                    <Input :disabled="taskParams.type!=1" v-model="insurancePolicy1.additionalInsuranceNum" placeholder="">
                    </Input>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="缴费方式" prop="nsurancePayTypeCode">
                    <Select :disabled="taskParams.type!=1" v-model="insurancePolicy1.insurancePayTypeCode" class="task-process-detail-select">
                      <Option v-for="item in selectInsurancePayTypeData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                    </Select>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="年缴保费" prop="insuranceYearAmount">
                    <Input :disabled="taskParams.type!=1" v-model="insurancePolicy1.insuranceYearAmount" placeholder="">
                    </Input>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="应缴期数" prop="insuranceTotalTerms">
                    <Input :disabled="taskParams.type!=1" v-model="insurancePolicy1.insuranceTotalTerms" placeholder="">
                    </Input>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="已缴期数" prop="insurancePayedTerms">
                    <Input :disabled="taskParams.type!=1" v-model="insurancePolicy1.insurancePayedTerms" placeholder="">
                    </Input>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="投保人是否有变更" prop="policyholderChanged">
                    <Select :disabled="taskParams.type!=1" v-model="insurancePolicy1.policyholderChanged" class="task-process-detail-select">
                      <Option v-for="item in selectPolicyholderChangedData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                    </Select>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="保单是否存在保单贷款" prop="insuranceExistLoan">
                    <Select :disabled="taskParams.type!=1" v-model="insurancePolicy1.insuranceExistLoan" class="task-process-detail-select">
                      <Option v-for="item in selectInsuranceExistLoanData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                    </Select>
                  </FormItem>
                  </Col>
                </Row>
                </Col>
                <Col span="12">
                <Collapse value="1">
                  <Panel name="1" :class="screenCaptureCheckActive1">
                    保单截屏是否齐全
                    <p slot="content">
                      <Row>
                        <Col span="10">
                        <FormItem prop="insuranceCheck.screenCaptureCheck">
                          <RadioGroup v-model="insurancePolicy1.insuranceCheck.screenCaptureCheck">
                            <Radio :disabled="taskParams.isModal==true" v-for="item in selectRadioGroup1" :key="item.code" :label="item.code">{{ item.name }}</Radio>
                          </RadioGroup>
                        </FormItem>
                        </Col>
                        <Col span="14">
                        <FormItem label="备注" prop="insuranceCheck.screenCaptureRemark">
                          <Input v-model="insurancePolicy1.insuranceCheck.screenCaptureRemark" :disabled="insurancePolicy1.insuranceCheck.screenCaptureCheck == 1 || taskParams.type!=1"></Input>
                        </FormItem>
                        </Col>
                      </Row>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" :class="phoneCheckResultActive1">
                    电核保单是否正常
                    <p slot="content">
                      <Row>
                        <Col span="10">
                        <FormItem prop="insuranceCheck.phoneCheckResult">
                          <RadioGroup v-model="insurancePolicy1.insuranceCheck.phoneCheckResult">
                            <Radio :disabled="taskParams.isModal==true" v-for="item in selectRadioGroup1" :key="item.code" :label="item.code">{{ item.name }}</Radio>
                          </RadioGroup>
                        </FormItem>
                        </Col>
                        <Col span="14">
                        <FormItem label="备注" prop="insuranceCheck.phoneCheckRemark">
                          <Input v-model="insurancePolicy1.insuranceCheck.phoneCheckRemark" :disabled="insurancePolicy1.insuranceCheck.phoneCheckResult == 1 || taskParams.type!=1"></Input>
                        </FormItem>
                        </Col>
                      </Row>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" :class="policyDisbursementsStatusActive1">
                    保单是否垫缴
                    <p slot="content">
                      <FormItem prop="insuranceCheck.policyDisbursementsStatus">
                        <RadioGroup v-model="insurancePolicy1.insuranceCheck.policyDisbursementsStatus">
                          <Radio :disabled="taskParams.isModal==true" v-for="item in selectRadioGroup1" :key="item.code" :label="item.code">{{ item.name }}</Radio>
                        </RadioGroup>
                      </FormItem>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" :class="recently3YOffpayStatusActive1">
                    最近三年是否有断缴、复效
                    <p slot="content">
                      <FormItem prop="insuranceCheck.recently3YOffpayStatus">
                        <RadioGroup v-model="insurancePolicy1.insuranceCheck.recently3YOffpayStatus">
                          <Radio :disabled="taskParams.isModal==true" v-for="item in selectRadioGroup1" :key="item.code" :label="item.code">{{ item.name }}</Radio>
                        </RadioGroup>
                      </FormItem>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" :class="recentlyYChangePayTypeActive1">
                    最近一年是否有更换缴费方式
                    <p slot="content">
                      <FormItem prop="insuranceCheck.recentlyYChangePayType">
                        <RadioGroup v-model="insurancePolicy1.insuranceCheck.recentlyYChangePayType">
                          <Radio :disabled="taskParams.isModal==true" v-for="item in selectRadioGroup1" :key="item.code" :label="item.code">{{ item.name }}</Radio>
                        </RadioGroup>
                      </FormItem>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" :class="recordFullStatusActive1">
                    录音是否完整
                    <p slot="content">
                      <Row>
                        <Col span="10">
                        <FormItem prop="insuranceCheck.recordFullStatus">
                          <RadioGroup v-model="insurancePolicy1.insuranceCheck.recordFullStatus">
                            <Radio :disabled="taskParams.isModal==true" v-for="item in selectRadioGroup1" :key="item.code" :label="item.code">{{ item.name }}</Radio>
                          </RadioGroup>
                        </FormItem>
                        </Col>
                        <Col span="14">
                        <FormItem label="备注" prop="insuranceCheck.recordFullRemark">
                          <Input v-model="insurancePolicy1.insuranceCheck.recordFullRemark" :disabled="insurancePolicy1.insuranceCheck.recordFullStatus == 1 || taskParams.isModal==true"></Input>
                        </FormItem>
                        </Col>
                      </Row>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" :class="quizStatusActive1">
                    是否按政策要求提问
                    <p slot="content">
                      <FormItem prop="insuranceCheck.quizStatus">
                        <RadioGroup v-model="insurancePolicy1.insuranceCheck.quizStatus">
                          <Radio :disabled="taskParams.isModal==true" v-for="item in selectRadioGroup1" :key="item.code" :label="item.code">{{ item.name }}</Radio>
                        </RadioGroup>
                      </FormItem>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" :class="selfPolicyActive1">
                    是否为借款人本人的保单
                    <p slot="content">
                      <FormItem prop="insuranceCheck.selfPolicy">
                        <RadioGroup v-model="insurancePolicy1.insuranceCheck.selfPolicy">
                          <Radio :disabled="taskParams.isModal==true" v-for="item in selectRadioGroup1" :key="item.code" :label="item.code">{{ item.name }}</Radio>
                        </RadioGroup>
                      </FormItem>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" :class="otherQuestionActive1">
                    是否有其他问题
                    <p slot="content">
                      <Row>
                        <Col span="10">
                        <FormItem prop="insuranceCheck.otherQuestion">
                          <RadioGroup v-model="insurancePolicy1.insuranceCheck.otherQuestion">
                            <Radio :disabled="taskParams.isModal==true" v-for="item in selectRadioGroup2" :key="item.code" :label="item.code">{{ item.name }}</Radio>
                          </RadioGroup>
                        </FormItem>
                        </Col>
                        <Col span="14">
                        <FormItem label="备注">
                          <Input v-model="insurancePolicy1.insuranceCheck.otherQuestionRemark" :disabled="insurancePolicy1.insuranceCheck.otherQuestion == 0 || taskParams.isModal==true"></Input>
                        </FormItem>
                        </Col>
                      </Row>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" class="alert-info">
                    最近一次缴费的时间
                    <span class="collapse-panel-title">{{lastPayDateLabel}}</span>
                    <p slot="content">
                      <FormItem label="时间" prop="insuranceCheck.lastPayDate">
                        <DatePicker :disabled="taskParams.isModal==true" @on-change="showLastPayDateLabel" v-model="insurancePolicy1.insuranceCheck.lastPayDate" :value="insurancePolicy1.insuranceCheck.lastPayDate" type="date"></DatePicker>
                      </FormItem>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" class="alert-info">
                    最近一次缴费的金额
                    <span class="collapse-panel-title">￥{{insurancePolicy1.insuranceCheck.lastPayAmount}}</span>
                    <p slot="content">
                      <FormItem label="金额" prop="insuranceCheck.lastPayAmount">
                        <Input :disabled="taskParams.isModal==true" v-model="insurancePolicy1.insuranceCheck.lastPayAmount"></Input>
                      </FormItem>
                    </p>
                  </Panel>
                </Collapse>
                </Col>
                <div align="center" v-if="taskParams.isModal==false">
                  <Button type="primary" @click="submitForm1">保存</Button>
                </div>
              </Row>

            </Form>
          </p>
        </Panel>
      </Collapse>
      <Collapse value="1" v-if="((loanInfoForm.productType==='1' || loanInfoForm.productType==='17')&& insurancePolicy2.insuranceId!=null && insurancePolicy2.insuranceId!='')">
        <Panel name="1">
          保单信息
          <p slot="content">
            <Form ref="insurancePolicy2" :model="insurancePolicy2" :rules="insurancePolicy2Rule"  :label-width="90" inline>
              <Row>
                <Col span="12">
                <Row>
                  <Col span="24">
                  <FormItem label="保险公司" prop="insuranceCpyCode">
                    <Select :disabled="taskParams.type!=1" v-model="insurancePolicy2.insuranceCpyCode" class="task-process-detail-select">
                      <Option v-for="item in selectInsuranceCpyData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                    </Select>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="保单号" prop="insuranceNum">
                    <Input :disabled="taskParams.type!=1" v-model="insurancePolicy2.insuranceNum" placeholder="">
                    </Input>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="主险名称" prop="insuranceName">
                    <Input :disabled="taskParams.type!=1" v-model="insurancePolicy2.insuranceName" placeholder="">
                    </Input>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="保单类型" prop="insuranceType">
                    <Select :disabled="taskParams.type!=1" v-model="insurancePolicy2.insuranceType" class="task-process-detail-select">
                      <Option v-for="item in selectInsuranceTypeData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                    </Select>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="寿险类型" prop="lifeInsuranceType">
                    <Select :disabled="taskParams.type!=1" v-model="insurancePolicy2.lifeInsuranceType" class="task-process-detail-select">
                      <Option v-for="item in selectLifeInsuranceTypeData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                    </Select>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="保单生效日" prop="insuranceEftDate">
                    <DatePicker :disabled="taskParams.type!=1" v-model="insurancePolicy2.insuranceEftDate" :value="insurancePolicy2.insuranceEftDate" type="date" placeholder=""></DatePicker>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="保费总额" prop="insuranceAmount">
                    <Input :disabled="taskParams.type!=1" v-model="insurancePolicy2.insuranceAmount" placeholder="">
                    </Input>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="保单状态" prop="insuranceStatus">
                    <Select :disabled="taskParams.type!=1" v-model="insurancePolicy2.insuranceStatus" class="task-process-detail-select">
                      <Option v-for="item in selectInsuranceStatusData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                    </Select>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="投保年限" prop="insuranceYears">
                    <Input :disabled="taskParams.type!=1" v-model="insurancePolicy2.insuranceYears" placeholder="">
                    </Input>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="附加险数量" prop="additionalInsuranceNum">
                    <Input :disabled="taskParams.type!=1" v-model="insurancePolicy2.additionalInsuranceNum" placeholder="">
                    </Input>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="缴费方式" prop="nsurancePayTypeCode">
                    <Select :disabled="taskParams.type!=1" v-model="insurancePolicy2.insurancePayTypeCode" class="task-process-detail-select">
                      <Option v-for="item in selectInsurancePayTypeData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                    </Select>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="年缴保费" prop="insuranceYearAmount">
                    <Input :disabled="taskParams.type!=1" v-model="insurancePolicy2.insuranceYearAmount" placeholder="">
                    </Input>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="应缴期数" prop="insuranceTotalTerms">
                    <Input :disabled="taskParams.type!=1" v-model="insurancePolicy2.insuranceTotalTerms" placeholder="">
                    </Input>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="已缴期数" prop="insurancePayedTerms">
                    <Input :disabled="taskParams.type!=1" v-model="insurancePolicy2.insurancePayedTerms" placeholder="">
                    </Input>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="投保人是否有变更" prop="policyholderChanged">
                    <Select :disabled="taskParams.type!=1" v-model="insurancePolicy2.policyholderChanged" class="task-process-detail-select">
                      <Option v-for="item in selectPolicyholderChangedData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                    </Select>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="保单是否存在保单贷款" prop="insuranceExistLoan">
                    <Select :disabled="taskParams.type!=1" v-model="insurancePolicy2.insuranceExistLoan" class="task-process-detail-select">
                      <Option v-for="item in selectInsuranceExistLoanData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                    </Select>
                  </FormItem>
                  </Col>
                </Row>
                </Col>
                <Col span="12">
                <Collapse value="1">
                  <Panel name="1" :class="screenCaptureCheckActive2">
                    保单截屏是否齐全
                    <p slot="content">
                      <Row>
                        <Col span="10">
                        <FormItem prop="insuranceCheck.screenCaptureCheck">
                          <RadioGroup v-model="insurancePolicy2.insuranceCheck.screenCaptureCheck">
                            <Radio :disabled="taskParams.isModal==true" v-for="item in selectRadioGroup1" :key="item.code" :label="item.code">{{ item.name }}</Radio>
                          </RadioGroup>
                        </FormItem>
                        </Col>
                        <Col span="14">
                        <FormItem label="备注" prop="insuranceCheck.screenCaptureRemark">
                          <Input v-model="insurancePolicy2.insuranceCheck.screenCaptureRemark" :disabled="insurancePolicy2.insuranceCheck.screenCaptureCheck == 1 || taskParams.type!=1"></Input>
                        </FormItem>
                        </Col>
                      </Row>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" :class="phoneCheckResultActive2">
                    电核保单是否正常
                    <p slot="content">
                      <Row>
                        <Col span="10">
                        <FormItem prop="insuranceCheck.phoneCheckResult">
                          <RadioGroup v-model="insurancePolicy2.insuranceCheck.phoneCheckResult">
                            <Radio :disabled="taskParams.isModal==true" v-for="item in selectRadioGroup1" :key="item.code" :label="item.code">{{ item.name }}</Radio>
                          </RadioGroup>
                        </FormItem>
                        </Col>
                        <Col span="14">
                        <FormItem label="备注" prop="insuranceCheck.phoneCheckRemark">
                          <Input v-model="insurancePolicy2.insuranceCheck.phoneCheckRemark" :disabled="insurancePolicy2.insuranceCheck.phoneCheckResult == 1 || taskParams.type!=1"></Input>
                        </FormItem>
                        </Col>
                      </Row>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" :class="policyDisbursementsStatusActive2">
                    保单是否垫缴
                    <p slot="content">
                      <FormItem prop="insuranceCheck.policyDisbursementsStatus">
                        <RadioGroup v-model="insurancePolicy2.insuranceCheck.policyDisbursementsStatus">
                          <Radio :disabled="taskParams.isModal==true" v-for="item in selectRadioGroup1" :key="item.code" :label="item.code">{{ item.name }}</Radio>
                        </RadioGroup>
                      </FormItem>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" :class="recently3YOffpayStatusActive2">
                    最近三年是否有断缴、复效
                    <p slot="content">
                      <FormItem prop="insuranceCheck.recently3YOffpayStatus">
                        <RadioGroup v-model="insurancePolicy2.insuranceCheck.recently3YOffpayStatus">
                          <Radio :disabled="taskParams.isModal==true" v-for="item in selectRadioGroup1" :key="item.code" :label="item.code">{{ item.name }}</Radio>
                        </RadioGroup>
                      </FormItem>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" :class="recentlyYChangePayTypeActive2">
                    最近一年是否有更换缴费方式
                    <p slot="content">
                      <FormItem prop="insuranceCheck.recentlyYChangePayType">
                        <RadioGroup v-model="insurancePolicy2.insuranceCheck.recentlyYChangePayType">
                          <Radio :disabled="taskParams.isModal==true" v-for="item in selectRadioGroup1" :key="item.code" :label="item.code">{{ item.name }}</Radio>
                        </RadioGroup>
                      </FormItem>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" :class="recordFullStatusActive2">
                    录音是否完整
                    <p slot="content">
                      <Row>
                        <Col span="10">
                        <FormItem prop="insuranceCheck.recordFullStatus">
                          <RadioGroup v-model="insurancePolicy2.insuranceCheck.recordFullStatus">
                            <Radio :disabled="taskParams.isModal==true" v-for="item in selectRadioGroup1" :key="item.code" :label="item.code">{{ item.name }}</Radio>
                          </RadioGroup>
                        </FormItem>
                        </Col>
                        <Col span="14">
                        <FormItem label="备注" prop="insuranceCheck.recordFullRemark">
                          <Input v-model="insurancePolicy2.insuranceCheck.recordFullRemark" :disabled="insurancePolicy2.insuranceCheck.recordFullStatus == 1 || taskParams.isModal==true"></Input>
                        </FormItem>
                        </Col>
                      </Row>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" :class="quizStatusActive2">
                    是否按政策要求提问
                    <p slot="content">
                      <FormItem prop="insuranceCheck.quizStatus">
                        <RadioGroup v-model="insurancePolicy2.insuranceCheck.quizStatus">
                          <Radio :disabled="taskParams.isModal==true" v-for="item in selectRadioGroup1" :key="item.code" :label="item.code">{{ item.name }}</Radio>
                        </RadioGroup>
                      </FormItem>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" :class="selfPolicyActive2">
                    是否为借款人本人的保单
                    <p slot="content">
                      <FormItem prop="insuranceCheck.selfPolicy">
                        <RadioGroup v-model="insurancePolicy2.insuranceCheck.selfPolicy">
                          <Radio :disabled="taskParams.isModal==true" v-for="item in selectRadioGroup1" :key="item.code" :label="item.code">{{ item.name }}</Radio>
                        </RadioGroup>
                      </FormItem>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" :class="otherQuestionActive2">
                    是否有其他问题
                    <p slot="content">
                      <Row>
                        <Col span="10">
                        <FormItem prop="insuranceCheck.otherQuestion">
                          <RadioGroup v-model="insurancePolicy2.insuranceCheck.otherQuestion">
                            <Radio :disabled="taskParams.isModal==true" v-for="item in selectRadioGroup2" :key="item.code" :label="item.code">{{ item.name }}</Radio>
                          </RadioGroup>
                        </FormItem>
                        </Col>
                        <Col span="14">
                        <FormItem label="备注">
                          <Input v-model="insurancePolicy2.insuranceCheck.otherQuestionRemark" :disabled="insurancePolicy2.insuranceCheck.otherQuestion == 0 || taskParams.isModal==true"></Input>
                        </FormItem>
                        </Col>
                      </Row>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" class="alert-info">
                    最近一次缴费的时间
                    <span class="collapse-panel-title">{{lastPayDateLabel}}</span>
                    <p slot="content">
                      <FormItem label="时间" prop="insuranceCheck.lastPayDate">
                        <DatePicker :disabled="taskParams.isModal==true" @on-change="showLastPayDateLabel" v-model="insurancePolicy2.insuranceCheck.lastPayDate" :value="insurancePolicy2.insuranceCheck.lastPayDate" type="date"></DatePicker>
                      </FormItem>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" class="alert-info">
                    最近一次缴费的金额
                    <span class="collapse-panel-title">￥{{insurancePolicy2.insuranceCheck.lastPayAmount}}</span>
                    <p slot="content">
                      <FormItem label="金额" prop="insuranceCheck.lastPayAmount">
                        <Input :disabled="taskParams.isModal==true" v-model="insurancePolicy2.insuranceCheck.lastPayAmount"></Input>
                      </FormItem>
                    </p>
                  </Panel>
                </Collapse>
                </Col>
                <div align="center" v-if="taskParams.isModal==false">
                  <Button type="primary" @click="submitForm2">保存</Button>
                </div>
              </Row>

            </Form>
          </p>
        </Panel>
      </Collapse>

      <Collapse value="1" v-if="((loanInfoForm.productType==='1' || loanInfoForm.productType==='17')&& insurancePolicy3.insuranceId!=null && insurancePolicy3.insuranceId!='')">
        <Panel name="1">
          保单信息
          <p slot="content">
            <Form ref="insurancePolicy3" :model="insurancePolicy3" :rules="insurancePolicy3Rule"  :label-width="90" inline>
              <Row>
                <Col span="12">
                <Row>
                  <Col span="24">
                  <FormItem label="保险公司" prop="insuranceCpyCode">
                    <Select :disabled="taskParams.type!=1" v-model="insurancePolicy3.insuranceCpyCode" class="task-process-detail-select">
                      <Option v-for="item in selectInsuranceCpyData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                    </Select>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="保单号" prop="insuranceNum">
                    <Input :disabled="taskParams.type!=1" v-model="insurancePolicy3.insuranceNum" placeholder="">
                    </Input>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="主险名称" prop="insuranceName">
                    <Input :disabled="taskParams.type!=1" v-model="insurancePolicy3.insuranceName" placeholder="">
                    </Input>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="保单类型" prop="insuranceType">
                    <Select :disabled="taskParams.type!=1" v-model="insurancePolicy3.insuranceType" class="task-process-detail-select">
                      <Option v-for="item in selectInsuranceTypeData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                    </Select>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="寿险类型" prop="lifeInsuranceType">
                    <Select :disabled="taskParams.type!=1" v-model="insurancePolicy3.lifeInsuranceType" class="task-process-detail-select">
                      <Option v-for="item in selectLifeInsuranceTypeData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                    </Select>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="保单生效日" prop="insuranceEftDate">
                    <DatePicker :disabled="taskParams.type!=1" v-model="insurancePolicy3.insuranceEftDate" :value="insurancePolicy3.insuranceEftDate" type="date" placeholder=""></DatePicker>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="保费总额" prop="insuranceAmount">
                    <Input :disabled="taskParams.type!=1" v-model="insurancePolicy3.insuranceAmount" placeholder="">
                    </Input>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="保单状态" prop="insuranceStatus">
                    <Select :disabled="taskParams.type!=1" v-model="insurancePolicy3.insuranceStatus" class="task-process-detail-select">
                      <Option v-for="item in selectInsuranceStatusData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                    </Select>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="投保年限" prop="insuranceYears">
                    <Input :disabled="taskParams.type!=1" v-model="insurancePolicy3.insuranceYears" placeholder="">
                    </Input>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="附加险数量" prop="additionalInsuranceNum">
                    <Input :disabled="taskParams.type!=1" v-model="insurancePolicy3.additionalInsuranceNum" placeholder="">
                    </Input>
                  </FormItem>
                  </Col>
                </Row>

                <Row>
                  <Col span="24">
                  <FormItem label="缴费方式" prop="nsurancePayTypeCode">
                    <Select :disabled="taskParams.type!=1" v-model="insurancePolicy3.insurancePayTypeCode" class="task-process-detail-select">
                      <Option v-for="item in selectInsurancePayTypeData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                    </Select>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="年缴保费" prop="insuranceYearAmount">
                    <Input :disabled="taskParams.type!=1" v-model="insurancePolicy3.insuranceYearAmount" placeholder="">
                    </Input>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="应缴期数" prop="insuranceTotalTerms">
                    <Input :disabled="taskParams.type!=1" v-model="insurancePolicy3.insuranceTotalTerms" placeholder="">
                    </Input>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="已缴期数" prop="insurancePayedTerms">
                    <Input :disabled="taskParams.type!=1" v-model="insurancePolicy3.insurancePayedTerms" placeholder="">
                    </Input>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="投保人是否有变更" prop="policyholderChanged">
                    <Select :disabled="taskParams.type!=1" v-model="insurancePolicy3.policyholderChanged" class="task-process-detail-select">
                      <Option v-for="item in selectPolicyholderChangedData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                    </Select>
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="24">
                  <FormItem label="保单是否存在保单贷款" prop="insuranceExistLoan">
                    <Select :disabled="taskParams.type!=1" v-model="insurancePolicy3.insuranceExistLoan" class="task-process-detail-select">
                      <Option v-for="item in selectInsuranceExistLoanData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                    </Select>
                  </FormItem>
                  </Col>
                </Row>
                </Col>
                <Col span="12">
                <Collapse value="1">
                  <Panel name="1" :class="screenCaptureCheckActive3">
                    保单截屏是否齐全
                    <p slot="content">
                      <Row>
                        <Col span="10">
                        <FormItem prop="insuranceCheck.screenCaptureCheck">
                          <RadioGroup v-model="insurancePolicy3.insuranceCheck.screenCaptureCheck">
                            <Radio :disabled="taskParams.isModal==true" v-for="item in selectRadioGroup1" :key="item.code" :label="item.code">{{ item.name }}</Radio>
                          </RadioGroup>
                        </FormItem>
                        </Col>
                        <Col span="14">
                        <FormItem label="备注" prop="insuranceCheck.screenCaptureRemark">
                          <Input v-model="insurancePolicy3.insuranceCheck.screenCaptureRemark" :disabled="insurancePolicy3.insuranceCheck.screenCaptureCheck == 1 || taskParams.type!=1"></Input>
                        </FormItem>
                        </Col>
                      </Row>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" :class="phoneCheckResultActive3">
                    电核保单是否正常
                    <p slot="content">
                      <Row>
                        <Col span="10">
                        <FormItem prop="insuranceCheck.phoneCheckResult">
                          <RadioGroup v-model="insurancePolicy3.insuranceCheck.phoneCheckResult">
                            <Radio :disabled="taskParams.isModal==true" v-for="item in selectRadioGroup1" :key="item.code" :label="item.code">{{ item.name }}</Radio>
                          </RadioGroup>
                        </FormItem>
                        </Col>
                        <Col span="14">
                        <FormItem label="备注" prop="insuranceCheck.phoneCheckRemark">
                          <Input v-model="insurancePolicy3.insuranceCheck.phoneCheckRemark" :disabled="insurancePolicy3.insuranceCheck.phoneCheckResult == 1 || taskParams.type!=1"></Input>
                        </FormItem>
                        </Col>
                      </Row>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" :class="policyDisbursementsStatusActive3">
                    保单是否垫缴
                    <p slot="content">
                      <FormItem prop="insuranceCheck.policyDisbursementsStatus">
                        <RadioGroup v-model="insurancePolicy3.insuranceCheck.policyDisbursementsStatus">
                          <Radio :disabled="taskParams.isModal==true" v-for="item in selectRadioGroup1" :key="item.code" :label="item.code">{{ item.name }}</Radio>
                        </RadioGroup>
                      </FormItem>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" :class="recently3YOffpayStatusActive3">
                    最近三年是否有断缴、复效
                    <p slot="content">
                      <FormItem prop="insuranceCheck.recently3YOffpayStatus">
                        <RadioGroup v-model="insurancePolicy3.insuranceCheck.recently3YOffpayStatus">
                          <Radio :disabled="taskParams.isModal==true" v-for="item in selectRadioGroup1" :key="item.code" :label="item.code">{{ item.name }}</Radio>
                        </RadioGroup>
                      </FormItem>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" :class="recentlyYChangePayTypeActive3">
                    最近一年是否有更换缴费方式
                    <p slot="content">
                      <FormItem prop="insuranceCheck.recentlyYChangePayType">
                        <RadioGroup v-model="insurancePolicy3.insuranceCheck.recentlyYChangePayType">
                          <Radio :disabled="taskParams.isModal==true" v-for="item in selectRadioGroup1" :key="item.code" :label="item.code">{{ item.name }}</Radio>
                        </RadioGroup>
                      </FormItem>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" :class="recordFullStatusActive3">
                    录音是否完整
                    <p slot="content">
                      <Row>
                        <Col span="10">
                        <FormItem prop="insuranceCheck.recordFullStatus">
                          <RadioGroup v-model="insurancePolicy3.insuranceCheck.recordFullStatus">
                            <Radio :disabled="taskParams.isModal==true" v-for="item in selectRadioGroup1" :key="item.code" :label="item.code">{{ item.name }}</Radio>
                          </RadioGroup>
                        </FormItem>
                        </Col>
                        <Col span="14">
                        <FormItem label="备注" prop="insuranceCheck.recordFullRemark">
                          <Input v-model="insurancePolicy3.insuranceCheck.recordFullRemark" :disabled="insurancePolicy3.insuranceCheck.recordFullStatus == 1 || taskParams.isModal==true"></Input>
                        </FormItem>
                        </Col>
                      </Row>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" :class="quizStatusActive3">
                    是否按政策要求提问
                    <p slot="content">
                      <FormItem prop="insuranceCheck.quizStatus">
                        <RadioGroup v-model="insurancePolicy3.insuranceCheck.quizStatus">
                          <Radio :disabled="taskParams.isModal==true" v-for="item in selectRadioGroup1" :key="item.code" :label="item.code">{{ item.name }}</Radio>
                        </RadioGroup>
                      </FormItem>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" :class="selfPolicyActive3">
                    是否为借款人本人的保单
                    <p slot="content">
                      <FormItem prop="insuranceCheck.selfPolicy">
                        <RadioGroup v-model="insurancePolicy3.insuranceCheck.selfPolicy">
                          <Radio :disabled="taskParams.isModal==true" v-for="item in selectRadioGroup1" :key="item.code" :label="item.code">{{ item.name }}</Radio>
                        </RadioGroup>
                      </FormItem>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" :class="otherQuestionActive3">
                    是否有其他问题
                    <p slot="content">
                      <Row>
                        <Col span="10">
                        <FormItem prop="insuranceCheck.otherQuestion">
                          <RadioGroup v-model="insurancePolicy3.insuranceCheck.otherQuestion">
                            <Radio :disabled="taskParams.isModal==true" v-for="item in selectRadioGroup2" :key="item.code" :label="item.code">{{ item.name }}</Radio>
                          </RadioGroup>
                        </FormItem>
                        </Col>
                        <Col span="14">
                        <FormItem label="备注">
                          <Input v-model="insurancePolicy3.insuranceCheck.otherQuestionRemark" :disabled="insurancePolicy3.insuranceCheck.otherQuestion == 0 || taskParams.isModal==true"></Input>
                        </FormItem>
                        </Col>
                      </Row>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" class="alert-info">
                    最近一次缴费的时间
                    <span class="collapse-panel-title">{{lastPayDateLabel}}</span>
                    <p slot="content">
                      <FormItem label="时间" prop="insuranceCheck.lastPayDate">
                        <DatePicker :disabled="taskParams.isModal==true" @on-change="showLastPayDateLabel" v-model="insurancePolicy3.insuranceCheck.lastPayDate" :value="insurancePolicy3.insuranceCheck.lastPayDate" type="date"></DatePicker>
                      </FormItem>
                    </p>
                  </Panel>
                </Collapse>
                <br>
                <Collapse value="1">
                  <Panel name="1" class="alert-info">
                    最近一次缴费的金额
                    <span class="collapse-panel-title">￥{{insurancePolicy3.insuranceCheck.lastPayAmount}}</span>
                    <p slot="content">
                      <FormItem label="金额" prop="insuranceCheck.lastPayAmount">
                        <Input :disabled="taskParams.isModal==true" v-model="insurancePolicy3.insuranceCheck.lastPayAmount"></Input>
                      </FormItem>
                    </p>
                  </Panel>
                </Collapse>
                </Col>
                <div align="center" v-if="taskParams.isModal==false">
                  <Button type="primary" @click="submitForm3">保存</Button>
                </div>
              </Row>

            </Form>
          </p>
        </Panel>
      </Collapse>
      <br>
      <Row>
        <div align="center" v-if="(taskParams.isModal==false && loanInfoForm.productType==='4')">
          <Button type="primary" @click="submitForm">保存</Button>
        </div>
      </Row>
    </Form>
  </Card>
</template>

<script>
export default {
  name: 'loan-info-form',
  data () {
    return {
      baseUrl: this.$appContext.marvels_core_approve,
      $ajax: null,
      loanInfoForm: {// 贷款信息
        principalAmt: null,
        applyTerms: null,
        productTypeName: null,
        productCode: null,
        purposeCode: null,
        receiveBankName: null,
        receiveAcctName: null,
        receiveAcctNo: null,
        paymentBankName: null,
        paymentAcctName: null,
        paymentAcctNo: null,
        insurancePolicys: [// 保单信息
        ],
        type: 0// 1 编辑   0 新增     2 查看
      },
      // 保单1
      insurancePolicy1: {
        insuranceCpyCode: null,
        insuranceNum: null,
        insuranceName: null,
        insuranceType: null,
        lifeInsuranceType: null,
        insuranceEftDate: null,
        insuranceAmount: null,
        insuranceStatus: null,
        insuranceYears: null,
        additionalInsuranceNum: null,
        insurancePayTypeCode: null,
        insuranceYearAmount: null,
        insuranceTotalTerms: null,
        insurancePayedTerms: null,
        policyholderChanged: 0,
        insuranceExistLoan: 0,
        insuranceCheck: {
          screenCaptureCheck: null,
          screenCaptureRemark: null,
          phoneCheckResult: null,
          phoneCheckRemark: null,
          policyDisbursementsStatus: null,
          recently3YOffpayStatus: null,
          lastPayDate: null,
          lastPayAmount: null,
          recentlyYChangePayType: null,
          recordFullStatus: null,
          recordFullRemark: null,
          quizStatus: null,
          selfPolicy: null,
          otherQuestion: null,
          otherQuestionRemark: null
        }
      },
      // 保单2
      insurancePolicy2: {
        insuranceCpyCode: null,
        insuranceNum: null,
        insuranceName: null,
        insuranceType: null,
        lifeInsuranceType: null,
        insuranceEftDate: null,
        insuranceAmount: null,
        insuranceStatus: null,
        insuranceYears: null,
        additionalInsuranceNum: null,
        insurancePayTypeCode: null,
        insuranceYearAmount: null,
        insuranceTotalTerms: null,
        insurancePayedTerms: null,
        policyholderChanged: 0,
        insuranceExistLoan: 0,
        insuranceCheck: {
          screenCaptureCheck: null,
          screenCaptureRemark: null,
          phoneCheckResult: null,
          phoneCheckRemark: null,
          policyDisbursementsStatus: null,
          recently3YOffpayStatus: null,
          lastPayDate: null,
          lastPayAmount: null,
          recentlyYChangePayType: null,
          recordFullStatus: null,
          recordFullRemark: null,
          quizStatus: null,
          selfPolicy: null,
          otherQuestion: null,
          otherQuestionRemark: null
        }
      },
      // 保单3
      insurancePolicy3: {
        insuranceCpyCode: null,
        insuranceNum: null,
        insuranceName: null,
        insuranceType: null,
        lifeInsuranceType: null,
        insuranceEftDate: null,
        insuranceAmount: null,
        insuranceStatus: null,
        insuranceYears: null,
        additionalInsuranceNum: null,
        insurancePayTypeCode: null,
        insuranceYearAmount: null,
        insuranceTotalTerms: null,
        insurancePayedTerms: null,
        policyholderChanged: 0,
        insuranceExistLoan: 0,
        insuranceCheck: {
          screenCaptureCheck: null,
          screenCaptureRemark: null,
          phoneCheckResult: null,
          phoneCheckRemark: null,
          policyDisbursementsStatus: null,
          recently3YOffpayStatus: null,
          lastPayDate: null,
          lastPayAmount: null,
          recentlyYChangePayType: null,
          recordFullStatus: null,
          recordFullRemark: null,
          quizStatus: null,
          selfPolicy: null,
          otherQuestion: null,
          otherQuestionRemark: null
        }
      },
      loanInfoFormRules: {
        purposeCode: [{
          required: true,
          message: '借款用途不能为空',
          trigger: 'blur'
        }]
      },
      insurancePolicy1Rule: {
        insuranceCpyCode: [{
          required: true,
          message: '保险公司不能为空',
          trigger: 'blur'
        }],
        insuranceNum: [{
          required: true,
          message: '保单号不能为空',
          trigger: 'blur'
        }],
        insuranceType: [{
          required: true,
          message: '保单类型不能为空',
          trigger: 'blur'
        }],
        lifeInsuranceType: [{
          required: true,
          message: '寿险类型不能为空',
          trigger: 'blur'
        }],
        insuranceEftDate: [{
          required: true,
          type: 'date',
          message: '保单生效日不能为空',
          trigger: 'blur'
        }],
        insuranceAmount: [{
          message: '保费总额不能为非数字类型',
          trigger: 'blur',
          pattern: this.$util.regExpAmount
        }],
        insuranceStatus: [{
          required: true,
          message: '保单状态不能为空',
          trigger: 'blur'
        }],
        insuranceYears: [{
          required: true,
          message: '投保年限不能为空',
          trigger: 'blur'
        },
        {
          pattern: this.$util.regExpNum,
          message: '投保年限不能为非数字类型',
          trigger: 'blur'
        }],
        insurancePayTypeCode: [{
          required: true,
          message: '缴费方式不能为空',
          trigger: 'blur'
        }],
        insuranceYearAmount: [{
          required: true,
          message: '年缴保费不能为空',
          trigger: 'blur'
        },
        {
          pattern: this.$util.regExpAmount,
          message: '年缴保费不能为非数字类型',
          trigger: 'blur'
        }],
        insuranceTotalTerms: [{
          required: true,
          message: '应缴期数不能为空',
          trigger: 'blur'
        },
        {
          pattern: this.$util.regExpNum,
          message: '应缴期数不能为非数字类型',
          trigger: 'blur'
        }],
        insurancePayedTerms: [{
          required: true,
          message: '已缴期数不能为空',
          trigger: 'blur'
        },
        {
          pattern: this.$util.regExpNum,
          message: '已缴期数不能为非数字类型',
          trigger: 'blur'
        }],
        policyholderChanged: [{
          required: true,
          type: 'number',
          message: '投保人是否有变更不能为空',
          trigger: 'blur'
        }],
        insuranceExistLoan: [{
          required: true,
          type: 'number',
          message: '保单是否存在保单贷款不能为空',
          trigger: 'blur'
        }],
        additionalInsuranceNum: [{
          // required: true,
          // type:'number',
          pattern: this.$util.regExpNum,
          message: '附加险数量不能为非数字类型',
          trigger: 'blur'
        }],

        'insuranceCheck.screenCaptureCheck': [{
          required: true,
          // type:'number',
          message: '必填',
          trigger: 'blur'
        }],
        'insuranceCheck.phoneCheckResult': [{
          required: true,
          // type:'number',
          message: '必填',
          trigger: 'blur'
        }],
        'insuranceCheck.policyDisbursementsStatus': [{
          required: true,
          // type:'number',
          message: '必填',
          trigger: 'blur'
        }],
        'insuranceCheck.recently3YOffpayStatus': [{
          required: true,
          // type:'number',
          message: '必填',
          trigger: 'blur'
        }],
        'insuranceCheck.lastPayDate': [{
          required: true,
          type: 'date',
          message: '必填',
          trigger: 'blur'
        }],
        'insuranceCheck.lastPayAmount': [{
          required: true,
          message: '必填',
          trigger: 'blur'
        },
        {
          pattern: this.$util.regExpAmount,
          message: '最近一次缴费的金额不能为非数字',
          trigger: 'blur'
        }],
        'insuranceCheck.recentlyYChangePayType': [{
          required: true,
          // type:'number',
          message: '必填',
          trigger: 'blur'
        }],
        'insuranceCheck.recordFullStatus': [{
          required: true,
          // type:'number',
          message: '必填',
          trigger: 'blur'
        }],
        'insuranceCheck.quizStatus': [{
          required: true,
          // type:'number',
          message: '必填',
          trigger: 'blur'
        }],
        'insuranceCheck.selfPolicy': [{
          required: true,
          // type:'number',
          message: '必填',
          trigger: 'blur'
        }],
        'insuranceCheck.otherQuestion': [{
          required: true,
          // type:'number',
          message: '必填',
          trigger: 'blur'
        }]
      },
      insurancePolicy2Rule: {
        insuranceCpyCode: [{
          required: true,
          message: '保险公司不能为空',
          trigger: 'blur'
        }],
        insuranceNum: [{
          required: true,
          message: '保单号不能为空',
          trigger: 'blur'
        }],
        insuranceType: [{
          required: true,
          message: '保单类型不能为空',
          trigger: 'blur'
        }],
        lifeInsuranceType: [{
          required: true,
          message: '寿险类型不能为空',
          trigger: 'blur'
        }],
        insuranceEftDate: [{
          required: true,
          type: 'date',
          message: '保单生效日不能为空',
          trigger: 'blur'
        }],
        insuranceAmount: [{
          message: '保费总额不能为非数字类型',
          trigger: 'blur',
          pattern: this.$util.regExpAmount
        }],
        insuranceStatus: [{
          required: true,
          message: '保单状态不能为空',
          trigger: 'blur'
        }],
        insuranceYears: [{
          required: true,
          message: '投保年限不能为空',
          trigger: 'blur'
        },
        {
          pattern: this.$util.regExpNum,
          message: '投保年限不能为非数字类型',
          trigger: 'blur'
        }],
        insurancePayTypeCode: [{
          required: true,
          message: '缴费方式不能为空',
          trigger: 'blur'
        }],
        insuranceYearAmount: [{
          required: true,
          message: '年缴保费不能为空',
          trigger: 'blur'
        },
        {
          pattern: this.$util.regExpAmount,
          message: '年缴保费不能为非数字类型',
          trigger: 'blur'
        }],
        insuranceTotalTerms: [{
          required: true,
          message: '应缴期数不能为空',
          trigger: 'blur'
        },
        {
          pattern: this.$util.regExpNum,
          message: '应缴期数不能为非数字类型',
          trigger: 'blur'
        }],
        insurancePayedTerms: [{
          required: true,
          message: '已缴期数不能为空',
          trigger: 'blur'
        },
        {
          pattern: this.$util.regExpNum,
          message: '已缴期数不能为非数字类型',
          trigger: 'blur'
        }],
        policyholderChanged: [{
          required: true,
          type: 'number',
          message: '投保人是否有变更不能为空',
          trigger: 'blur'
        }],
        insuranceExistLoan: [{
          required: true,
          type: 'number',
          message: '保单是否存在保单贷款不能为空',
          trigger: 'blur'
        }],
        additionalInsuranceNum: [{
          // required: true,
          // type:'number',
          pattern: this.$util.regExpNum,
          message: '附加险数量不能为非数字类型',
          trigger: 'blur'
        }],

        'insuranceCheck.screenCaptureCheck': [{
          required: true,
          // type:'number',
          message: '必填',
          trigger: 'blur'
        }],
        'insuranceCheck.phoneCheckResult': [{
          required: true,
          // type:'number',
          message: '必填',
          trigger: 'blur'
        }],
        'insuranceCheck.policyDisbursementsStatus': [{
          required: true,
          // type:'number',
          message: '必填',
          trigger: 'blur'
        }],
        'insuranceCheck.recently3YOffpayStatus': [{
          required: true,
          // type:'number',
          message: '必填',
          trigger: 'blur'
        }],
        'insuranceCheck.lastPayDate': [{
          required: true,
          type: 'date',
          message: '必填',
          trigger: 'blur'
        }],
        'insuranceCheck.lastPayAmount': [{
          required: true,
          message: '必填',
          trigger: 'blur'
        },
        {
          pattern: this.$util.regExpAmount,
          message: '最近一次缴费的金额不能为非数字',
          trigger: 'blur'
        }],
        'insuranceCheck.recentlyYChangePayType': [{
          required: true,
          // type:'number',
          message: '必填',
          trigger: 'blur'
        }],
        'insuranceCheck.recordFullStatus': [{
          required: true,
          // type:'number',
          message: '必填',
          trigger: 'blur'
        }],
        'insuranceCheck.quizStatus': [{
          required: true,
          // type:'number',
          message: '必填',
          trigger: 'blur'
        }],
        'insuranceCheck.selfPolicy': [{
          required: true,
          // type:'number',
          message: '必填',
          trigger: 'blur'
        }],
        'insuranceCheck.otherQuestion': [{
          required: true,
          // type:'number',
          message: '必填',
          trigger: 'blur'
        }]
      },
      insurancePolicy3Rule: {
        insuranceCpyCode: [{
          required: true,
          message: '保险公司不能为空',
          trigger: 'blur'
        }],
        insuranceNum: [{
          required: true,
          message: '保单号不能为空',
          trigger: 'blur'
        }],
        insuranceType: [{
          required: true,
          message: '保单类型不能为空',
          trigger: 'blur'
        }],
        lifeInsuranceType: [{
          required: true,
          message: '寿险类型不能为空',
          trigger: 'blur'
        }],
        insuranceEftDate: [{
          required: true,
          type: 'date',
          message: '保单生效日不能为空',
          trigger: 'blur'
        }],
        insuranceAmount: [{
          message: '保费总额不能为非数字类型',
          trigger: 'blur',
          pattern: this.$util.regExpAmount
        }],
        insuranceStatus: [{
          required: true,
          message: '保单状态不能为空',
          trigger: 'blur'
        }],
        insuranceYears: [{
          required: true,
          message: '投保年限不能为空',
          trigger: 'blur'
        },
        {
          pattern: this.$util.regExpNum,
          message: '投保年限不能为非数字类型',
          trigger: 'blur'
        }],
        insurancePayTypeCode: [{
          required: true,
          message: '缴费方式不能为空',
          trigger: 'blur'
        }],
        insuranceYearAmount: [{
          required: true,
          message: '年缴保费不能为空',
          trigger: 'blur'
        },
        {
          pattern: this.$util.regExpAmount,
          message: '年缴保费不能为非数字类型',
          trigger: 'blur'
        }],
        insuranceTotalTerms: [{
          required: true,
          message: '应缴期数不能为空',
          trigger: 'blur'
        },
        {
          pattern: this.$util.regExpNum,
          message: '应缴期数不能为非数字类型',
          trigger: 'blur'
        }],
        insurancePayedTerms: [{
          required: true,
          message: '已缴期数不能为空',
          trigger: 'blur'
        },
        {
          pattern: this.$util.regExpNum,
          message: '已缴期数不能为非数字类型',
          trigger: 'blur'
        }],
        policyholderChanged: [{
          required: true,
          type: 'number',
          message: '投保人是否有变更不能为空',
          trigger: 'blur'
        }],
        insuranceExistLoan: [{
          required: true,
          type: 'number',
          message: '保单是否存在保单贷款不能为空',
          trigger: 'blur'
        }],
        additionalInsuranceNum: [{
          // required: true,
          // type:'number',
          pattern: this.$util.regExpNum,
          message: '附加险数量不能为非数字类型',
          trigger: 'blur'
        }],

        'insuranceCheck.screenCaptureCheck': [{
          required: true,
          // type:'number',
          message: '必填',
          trigger: 'blur'
        }],
        'insuranceCheck.phoneCheckResult': [{
          required: true,
          // type:'number',
          message: '必填',
          trigger: 'blur'
        }],
        'insuranceCheck.policyDisbursementsStatus': [{
          required: true,
          // type:'number',
          message: '必填',
          trigger: 'blur'
        }],
        'insuranceCheck.recently3YOffpayStatus': [{
          required: true,
          // type:'number',
          message: '必填',
          trigger: 'blur'
        }],
        'insuranceCheck.lastPayDate': [{
          required: true,
          type: 'date',
          message: '必填',
          trigger: 'blur'
        }],
        'insuranceCheck.lastPayAmount': [{
          required: true,
          message: '必填',
          trigger: 'blur'
        },
        {
          pattern: this.$util.regExpAmount,
          message: '最近一次缴费的金额不能为非数字',
          trigger: 'blur'
        }],
        'insuranceCheck.recentlyYChangePayType': [{
          required: true,
          // type:'number',
          message: '必填',
          trigger: 'blur'
        }],
        'insuranceCheck.recordFullStatus': [{
          required: true,
          // type:'number',
          message: '必填',
          trigger: 'blur'
        }],
        'insuranceCheck.quizStatus': [{
          required: true,
          // type:'number',
          message: '必填',
          trigger: 'blur'
        }],
        'insuranceCheck.selfPolicy': [{
          required: true,
          // type:'number',
          message: '必填',
          trigger: 'blur'
        }],
        'insuranceCheck.otherQuestion': [{
          required: true,
          // type:'number',
          message: '必填',
          trigger: 'blur'
        }]
      },
      selectPurposeData: [],
      columns2: [
        {
          title: '序号',
          type: 'index',
          align: 'center',
          width: 120
        },
        {
          align: 'center',
          title: '文件地址',
          key: 'fileName',
          render: function (h, params) {
            var fileName = params.row.fileLocation.substring(params.row.fileLocation.lastIndexOf('/') + 1)
            return h('a', {
              attrs: {
                href: params.row.fileLocation
              }
            }, fileName)
          }
        },
        {
          align: 'center',
          title: '文件识别结果',
          key: 'content'
        }
      ],
      recordingData: [],
      selectInsuranceCpyData: [],
      selectInsuranceTypeData: [],
      selectLifeInsuranceTypeData: [],
      selectInsuranceStatusData: [],
      selectInsurancePayTypeData: [],
      selectPolicyholderChangedData: [
        {
          code: 0,
          name: '否'
        },
        {
          code: 1,
          name: '是'
        }
      ],
      selectInsuranceExistLoanData: [
        {
          code: 0,
          name: '否'
        },
        {
          code: 1,
          name: '是'
        }
      ],
      columns3: [
        {
          align: 'center',
          title: '房产名称',
          key: 'fcName',
          render: function (h, params) {
            const vm = this
            return h('Input', {
              props: {
                type: 'text',
                disabled: vm.taskParams.isModal === true,
                value: params.row.fcName
              },
              on: {
                'on-change' (e) {
                  vm.initTempEstateDataObject(params)
                  vm.$set(vm.tempEstateData[params.index], 'fcName', e.target.value)
                }
              }
            })
          }.bind(this)
        },
        {
          align: 'center',
          title: '房产地址',
          key: 'address',
          render: function (h, params) {
            const vm = this
            return h('Input', {
              props: {
                type: 'text',
                disabled: vm.taskParams.isModal === true,
                value: params.row.address
              },
              on: {
                'on-change' (e) {
                  vm.initTempEstateDataObject(params)
                  vm.$set(vm.tempEstateData[params.index], 'address', e.target.value)
                }
              }
            })
          }.bind(this)
        },
        {
          align: 'center',
          title: '还款期数',
          key: 'repaymentPeriod',
          render: function (h, params) {
            const vm = this
            return h('Input', {
              props: {
                type: 'text',
                disabled: vm.taskParams.isModal === true,
                value: params.row.repaymentPeriod
              },
              on: {
                'on-change' (e) {
                  vm.initTempEstateDataObject(params)
                  vm.$set(vm.tempEstateData[params.index], 'repaymentPeriod', e.target.value)
                }
              }
            })
          }.bind(this)
        },
        {
          align: 'center',
          title: '还款开始时间',
          key: 'repaymentStartTime',
          render: function (h, params) {
            const vm = this
            return h('DatePicker', {
              props: {
                type: 'date',
                disabled: vm.taskParams.isModal === true,
                value: params.row.repaymentStartTime
              },
              on: {
                'on-change' (v1, v2) {
                  vm.initTempEstateDataObject(params)
                  vm.$set(vm.tempEstateData[params.index], 'repaymentStartTime', v1)
                }
              }
            })
          }.bind(this)
        },
        {
          align: 'center',
          title: '月还款额',
          key: 'monthlyPayment',
          render: function (h, params) {
            const vm = this
            return h('Input', {
              props: {
                type: 'text',
                disabled: vm.taskParams.isModal === true,
                value: params.row.monthlyPayment
              },
              on: {
                'on-change' (e) {
                  vm.initTempEstateDataObject(params)
                  vm.$set(vm.tempEstateData[params.index], 'monthlyPayment', e.target.value)
                }
              }
            })
          }.bind(this)
        },
        {
          align: 'center',
          title: '贷款状态',
          key: 'loanStatus',
          render: function (h, params) {
            const vm = this
            return h('Select', {
              props: {
                disabled: vm.taskParams.isModal === true,
                value: params.row.loanStatus
              },
              on: {
                'on-change' (value) {
                  vm.initTempEstateDataObject(params)
                  vm.$set(vm.tempEstateData[params.index], 'loanStatus', value)
                }
              }
            }, this.selectEstateLoanStatusData.map(function (item) {
              return h('Option', {
                props: {
                  value: item.code
                }
              }, item.name)
            })
            )
          }.bind(this)
        },
        {
          align: 'center',
          title: '操作',
          width: 80,
          key: 'action',
          render: (h, params) => {
            var vm = this
            if (vm.taskParams.isModal === true) {
              return ''
            } else {
              return h('div', [
                h('Button', {
                  props: {
                    type: 'error',
                    size: 'small'
                  },
                  on: {
                    click: () => {
                      // vm.tempEstateData.splice(params.index,1);
                      // vm.estateData = vm.cloneObject(vm.tempEstateData);
                      vm.delEstateRowData(params)
                    }
                  }
                }, ' 删除')
              ])
            }
          }
        }
      ],
      estateData: [ // 房产信息 表格数据
        // {
        //     estateName:'test',
        //     estateAddress:null,
        //     estateLoanStartDate:'20180501',
        //     estateLoanStatus:'0',
        //     estateLoanPaidTerms:null,
        //     estateLoanMthPayment:null
        // }
      ],
      tempEstateData: [], // 房产信息 临时表格数据
      estateEmptyRowData: { // 房产信息表格空行对象
        estateName: null,
        estateAddress: null,
        estateLoanStartDate: null,
        estateLoanStatus: null,
        estateLoanPaidTerms: null,
        estateLoanMthPayment: null
      },
      selectEstateLoanStatusData: [
        {
          code: '0',
          name: '未结清'
        },
        {
          code: '1',
          name: '已结清'
        }
      ],
      selectRadioGroup1: [
        {
          code: '0',
          name: '否'
        },
        {
          code: '1',
          name: '是'
        }
      ],
      selectRadioGroup2: [
        {
          code: '0',
          name: '无'
        },
        {
          code: '1',
          name: '有'
        }
      ],
      lastPayDateLabel: ''
    }
  },
  methods: {
    initpage: function () {
      // 初始化下拉列表数据
      this.initSelectData()
    },
    // 初始化下拉列表数据
    initSelectData () {
      var vm = this
      this.$ajax.post(this.baseUrl + 'approve/process/task_process/service/getBasicDatas').then(re => {
        var data = re.data
        var code = data.code
        var message = data.message
        if (code !== 'success') {
          this.$Message.warning(message)
          return
        }
        vm.selectPurposeData = data.data.purposeBasicData
        vm.selectInsuranceCpyData = data.data.insuranceCompanyBasicData
        vm.selectInsuranceTypeData = data.data.insuranceTypeBasicData
        vm.selectLifeInsuranceTypeData = data.data.lifeInsuranceTypeBasicData
        vm.selectInsuranceStatusData = data.data.insuranceStatusBasicData
        vm.selectInsurancePayTypeData = data.data.paymentModeBasicData
        // 初始化贷款信息tab
        vm.initLoanInfo()
      }).catch(er => {

      })
    },
    // 初始化贷款信息tab
    initLoanInfo () {
      var vm = this
      var url = this.baseUrl + 'approve/process/task_process/service/getLoanDetail/' + this.taskParams.curLoanId
      this.$ajax.get(url).then(re => {
        var data = re.data
        var code = data.code
        var message = data.message
        if (code !== 'success') {
          this.$Message.warning(message)
          return
        }
        vm.loanInfoForm = data.data
        if (!vm.loanInfoForm.insurancePolicys) {
          vm.loanInfoForm.insurancePolicys = []
        }
        var size = vm.loanInfoForm.insurancePolicys.length
        if (size === 1) {
          vm.insurancePolicy1 = vm.loanInfoForm.insurancePolicys[0]
        } else if (size === 2) {
          vm.insurancePolicy1 = vm.loanInfoForm.insurancePolicys[0]
          vm.insurancePolicy2 = vm.loanInfoForm.insurancePolicys[1]
        } else if (size === 3) {
          vm.insurancePolicy1 = vm.loanInfoForm.insurancePolicys[0]
          vm.insurancePolicy2 = vm.loanInfoForm.insurancePolicys[1]
          vm.insurancePolicy3 = vm.loanInfoForm.insurancePolicys[2]
        }
        if (vm.insurancePolicy1) {
          vm.insurancePolicy1.insuranceEftDate = vm.insurancePolicy1.insuranceEftDate ? new Date(vm.insurancePolicy1.insuranceEftDate) : ''
          vm.insurancePolicy1.insuranceCheck.lastPayDate = vm.insurancePolicy1.insuranceCheck.lastPayDate ? new Date(vm.insurancePolicy1.insuranceCheck.lastPayDate) : ''
          if (vm.insurancePolicy1.insuranceYears) {
            vm.insurancePolicy1.insuranceYears = vm.insurancePolicy1.insuranceYears + ''
          }
          if (vm.insurancePolicy1.insuranceYearAmount) {
            vm.insurancePolicy1.insuranceYearAmount = vm.insurancePolicy1.insuranceYearAmount + ''
          }
          if (vm.insurancePolicy1.insurancePayedTerms) {
            vm.insurancePolicy1.insurancePayedTerms = vm.insurancePolicy1.insurancePayedTerms + ''
          }
          if (vm.insurancePolicy1.insuranceTotalTerms) {
            vm.insurancePolicy1.insuranceTotalTerms = vm.insurancePolicy1.insuranceTotalTerms + ''
          }
          if (vm.insurancePolicy1.insuranceAmount) {
            vm.insurancePolicy1.insuranceAmount = vm.insurancePolicy1.insuranceAmount + ''
          }
          if (vm.insurancePolicy1.insuranceCheck.lastPayAmount) {
            vm.insurancePolicy1.insuranceCheck.lastPayAmount = vm.insurancePolicy1.insuranceCheck.lastPayAmount + ''
          }

          vm.showLastPayDateLabel(vm.insurancePolicy1.insuranceCheck.lastPayDate, vm.insurancePolicy1.insuranceCheck)
        }
        if (vm.insurancePolicy2) {
          vm.insurancePolicy2.insuranceEftDate = vm.insurancePolicy2.insuranceEftDate ? new Date(vm.insurancePolicy2.insuranceEftDate) : ''
          vm.insurancePolicy2.insuranceCheck.lastPayDate = vm.insurancePolicy2.insuranceCheck.lastPayDate ? new Date(vm.insurancePolicy2.insuranceCheck.lastPayDate) : ''
          if (vm.insurancePolicy2.insuranceYears) {
            vm.insurancePolicy2.insuranceYears = vm.insurancePolicy2.insuranceYears + ''
          }
          if (vm.insurancePolicy2.insuranceYearAmount) {
            vm.insurancePolicy2.insuranceYearAmount = vm.insurancePolicy2.insuranceYearAmount + ''
          }
          if (vm.insurancePolicy2.insurancePayedTerms) {
            vm.insurancePolicy2.insurancePayedTerms = vm.insurancePolicy2.insurancePayedTerms + ''
          }
          if (vm.insurancePolicy2.insuranceTotalTerms) {
            vm.insurancePolicy2.insuranceTotalTerms = vm.insurancePolicy2.insuranceTotalTerms + ''
          }
          if (vm.insurancePolicy2.insuranceAmount) {
            vm.insurancePolicy2.insuranceAmount = vm.insurancePolicy2.insuranceAmount + ''
          }
          if (vm.insurancePolicy2.insuranceCheck.lastPayAmount) {
            vm.insurancePolicy2.insuranceCheck.lastPayAmount = vm.insurancePolicy2.insuranceCheck.lastPayAmount + ''
          }
          vm.showLastPayDateLabel(vm.insurancePolicy2.insuranceCheck.lastPayDate, vm.insurancePolicy2.insuranceCheck)
        }

        if (vm.insurancePolicy3) {
          vm.insurancePolicy3.insuranceEftDate = vm.insurancePolicy3.insuranceEftDate ? new Date(vm.insurancePolicy3.insuranceEftDate) : ''
          vm.insurancePolicy3.insuranceCheck.lastPayDate = vm.insurancePolicy3.insuranceCheck.lastPayDate ? new Date(vm.insurancePolicy3.insuranceCheck.lastPayDate) : ''
          if (vm.insurancePolicy3.insuranceYears) {
            vm.insurancePolicy3.insuranceYears = vm.insurancePolicy3.insuranceYears + ''
          }
          if (vm.insurancePolicy3.insuranceYearAmount) {
            vm.insurancePolicy3.insuranceYearAmount = vm.insurancePolicy3.insuranceYearAmount + ''
          }
          if (vm.insurancePolicy3.insurancePayedTerms) {
            vm.insurancePolicy3.insurancePayedTerms = vm.insurancePolicy3.insurancePayedTerms + ''
          }
          if (vm.insurancePolicy3.insuranceTotalTerms) {
            vm.insurancePolicy3.insuranceTotalTerms = vm.insurancePolicy3.insuranceTotalTerms + ''
          }
          if (vm.insurancePolicy3.insuranceAmount) {
            vm.insurancePolicy3.insuranceAmount = vm.insurancePolicy3.insuranceAmount + ''
          }
          if (vm.insurancePolicy3.insuranceCheck.lastPayAmount) {
            vm.insurancePolicy3.insuranceCheck.lastPayAmount = vm.insurancePolicy3.insuranceCheck.lastPayAmount + ''
          }
          vm.showLastPayDateLabel(vm.insurancePolicy3.insuranceCheck.lastPayDate, vm.insurancePolicy3.insuranceCheck)
        }

        // 初始化房产信息
        vm.initEstateTable()
        // 初始化录音文件列表
        if (data.data.attachmentList) {
          vm.recordingData = data.data.attachmentList
        }
      }).catch(er => {

      })
    },
    // 初始化房产信息
    initEstateTable () {
      if (this.loanInfoForm.estateList && this.loanInfoForm.estateList.length > 0) {
        this.loadEstateData()
      }
    },
    // 加载房产信息
    loadEstateData () {
      this.estateData = this.loanInfoForm.estateList
      for (var i in this.estateData) {
        this.estateData[i].estateLoanStartDate = this.$util.formatDate(this.estateData[i].estateLoanStartDate)
      }
      // 初始化临时房产数组数据
      if (this.estateData && this.estateData.length > 0) {
        this.tempEstateData = this.cloneObject(this.estateData)
      }
    },
    // 保存贷款信息
    submitForm () {
      var vm = this
      this.$refs.loanInfoForm.validate(valid => {
        if (valid) {
          this.loanInfoForm.loanId = this.taskParams.curLoanId
          this.estateData = this.cloneObject(this.tempEstateData)
          this.loanInfoForm.estateList = this.estateData
          var params = this.loanInfoForm
          params.insurancePolicys = null
          if (vm.loanInfoForm.productType !== '4') { // 非房贷
            params.estateList = null
          }
          vm.$ajax.post(vm.baseUrl + 'approve/process/task_process/service/saveLoanInfo', params).then(re => {
            var data = re.data
            var code = data.code
            var message = data.message
            if (code !== 'success') {
              this.$Message.warning(message)
              return
            }
            // 重新加载房产信息
            vm.loanInfoForm.estateList = data.data.estateList
            vm.loadEstateData()
            this.$Message.success(message)
          }).catch(er => {

          })
        } else {
          this.$Message.warning('表单数据不合规，请检查')
        }
      })
    },
    // 保存保单信息
    submitForm1 () {
      this.$refs.insurancePolicy1.validate(valid => {
        if (valid) {
          this.loanInfoForm.loanId = null
          var params = this.loanInfoForm
          params.estateList = null
          var insurancePolicys = []
          insurancePolicys.push(this.insurancePolicy1)
          params.insurancePolicys = insurancePolicys
          params.saveBd = 1
          this.saveLoanInfo(params)
        } else {
          this.$Message.warning('表单数据不合规，请检查')
        }
      })
    },
    // 保存保单信息
    submitForm2 () {
      this.$refs.insurancePolicy2.validate(valid => {
        if (valid) {
          this.loanInfoForm.loanId = null
          var params = this.loanInfoForm
          params.estateList = null
          var insurancePolicys = []
          insurancePolicys.push(this.insurancePolicy2)
          params.insurancePolicys = insurancePolicys
          params.saveBd = 1
          this.saveLoanInfo(params)
        } else {
          this.$Message.warning('表单数据不合规，请检查')
        }
      })
    },
    // 保存保单信息
    submitForm3 () {
      this.$refs.insurancePolicy3.validate(valid => {
        if (valid) {
          this.loanInfoForm.loanId = null
          var params = this.loanInfoForm
          params.estateList = null
          var insurancePolicys = []
          insurancePolicys.push(this.insurancePolicy3)
          params.insurancePolicys = insurancePolicys
          params.saveBd = 1
          this.saveLoanInfo(params)
        } else {
          this.$Message.warning('表单数据不合规，请检查')
        }
      })
    },
    saveLoanInfo: function (params) {
      this.$ajax.post(this.baseUrl + 'approve/process/task_process/service/saveLoanInfo', params).then(re => {
        var data = re.data
        var code = data.code
        var message = data.message
        if (code !== 'success') {
          this.$Message.warning(message)
          return
        }
        this.$Message.success(message)
      }).catch(er => {

      })
    },
    // 房产信息列表 动态添加一行
    addEstateDefaultEmptyRow () {
      this.estateData = this.cloneObject(this.tempEstateData)
      this.estateData.push(this.cloneObject(this.estateEmptyRowData))
    },
    // 初始化临时房产数组数据对象
    initTempEstateDataObject (params) {
      if (!this.tempEstateData[params.index]) {
        this.tempEstateData[params.index] = {}
      }
    },
    // 复制对象
    cloneObject (obj) {
      return JSON.parse(JSON.stringify(obj))
    },
    // 删除房产信息
    delEstateRowData (params) {
      var vm = this
      var config = {
        title: '提示',
        content: '是否确认删除?',
        onOk: function () {
          var formData = params.row
          if (!formData.id) { // 新增但是还未保存的房产记录
            vm.tempEstateData.splice(params.index, 1)
            vm.estateData = vm.cloneObject(vm.tempEstateData)
            return
          }
          vm.$ajax.post(vm.baseUrl + 'approve/process/task_process/service/deleteEstateInfo', formData).then(re => {
            var data = re.data
            var code = data.code
            var message = data.message
            if (code !== 'success') {
              vm.$Message.warning(message)
              return
            }
            vm.tempEstateData.splice(params.index, 1)
            vm.estateData = vm.cloneObject(vm.tempEstateData)
          }).catch(er => {

          })
        }
      }
      this.$Modal.confirm(config)
    },
    showLastPayDateLabel (time, insuranceCheck) {
      this.lastPayDateLabel = ''
      if (insuranceCheck.lastPayDate) {
        this.lastPayDateLabel = this.$util.formatDate(insuranceCheck.lastPayDate)
      }
    }
  },
  computed: {
    screenCaptureCheckActive1: {
      get: function () {
        if (this.insurancePolicy1.insuranceCheck.screenCaptureCheck === '1') {
          return 'alert-success'
        } else if (this.insurancePolicy1.insuranceCheck.screenCaptureCheck === '0') {
          return 'alert-warning'
        }
        return ''
      },
      set: function () {

      }
    },
    phoneCheckResultActive1: {
      get: function () {
        if (this.insurancePolicy1.insuranceCheck.phoneCheckResult === '1') {
          return 'alert-success'
        } else if (this.insurancePolicy1.insuranceCheck.phoneCheckResult === '0') {
          return 'alert-warning'
        }
        return ''
      },
      set: function () {

      }
    },
    policyDisbursementsStatusActive1: {
      get: function () {
        if (this.insurancePolicy1.insuranceCheck.policyDisbursementsStatus === '1') {
          return 'alert-success'
        } else if (this.insurancePolicy1.insuranceCheck.policyDisbursementsStatus === '0') {
          return 'alert-warning'
        }
        return ''
      },
      set: function () {

      }
    },
    recently3YOffpayStatusActive1: {
      get: function () {
        if (this.insurancePolicy1.insuranceCheck.recently3YOffpayStatus === '1') {
          return 'alert-success'
        } else if (this.insurancePolicy1.insuranceCheck.recently3YOffpayStatus === '0') {
          return 'alert-warning'
        }
        return ''
      },
      set: function () {

      }
    },
    recentlyYChangePayTypeActive1: {
      get: function () {
        if (this.insurancePolicy1.insuranceCheck.recentlyYChangePayType === '1') {
          return 'alert-success'
        } else if (this.insurancePolicy1.insuranceCheck.recentlyYChangePayType === '0') {
          return 'alert-warning'
        }
        return ''
      },
      set: function () {

      }
    },
    recordFullStatusActive1: {
      get: function () {
        if (this.insurancePolicy1.insuranceCheck.recordFullStatus === '1') {
          return 'alert-success'
        } else if (this.insurancePolicy1.insuranceCheck.recordFullStatus === '0') {
          return 'alert-warning'
        }
        return ''
      },
      set: function () {

      }
    },
    quizStatusActive1: {
      get: function () {
        if (this.insurancePolicy1.insuranceCheck.quizStatus === '1') {
          return 'alert-success'
        } else if (this.insurancePolicy1.insuranceCheck.quizStatus === '0') {
          return 'alert-warning'
        }
        return ''
      },
      set: function () {

      }
    },
    selfPolicyActive1: {
      get: function () {
        if (this.insurancePolicy1.insuranceCheck.selfPolicy === '1') {
          return 'alert-success'
        } else if (this.insurancePolicy1.insuranceCheck.selfPolicy === '0') {
          return 'alert-warning'
        }
        return ''
      },
      set: function () {

      }
    },
    otherQuestionActive1: {
      get: function () {
        if (this.insurancePolicy1.insuranceCheck.otherQuestion === '1') {
          return 'alert-success'
        } else if (this.insurancePolicy1.insuranceCheck.otherQuestion === '0') {
          return 'alert-warning'
        }
        return ''
      },
      set: function () {

      }
    },
    screenCaptureCheckActive2: {
      get: function () {
        if (this.insurancePolicy2.insuranceCheck.screenCaptureCheck === '1') {
          return 'alert-success'
        } else if (this.insurancePolicy2.insuranceCheck.screenCaptureCheck === '0') {
          return 'alert-warning'
        }
        return ''
      },
      set: function () {

      }
    },
    phoneCheckResultActive2: {
      get: function () {
        if (this.insurancePolicy2.insuranceCheck.phoneCheckResult === '1') {
          return 'alert-success'
        } else if (this.insurancePolicy2.insuranceCheck.phoneCheckResult === '0') {
          return 'alert-warning'
        }
        return ''
      },
      set: function () {

      }
    },
    policyDisbursementsStatusActive2: {
      get: function () {
        if (this.insurancePolicy2.insuranceCheck.policyDisbursementsStatus === '1') {
          return 'alert-success'
        } else if (this.insurancePolicy2.insuranceCheck.policyDisbursementsStatus === '0') {
          return 'alert-warning'
        }
        return ''
      },
      set: function () {

      }
    },
    recently3YOffpayStatusActive2: {
      get: function () {
        if (this.insurancePolicy2.insuranceCheck.recently3YOffpayStatus === '1') {
          return 'alert-success'
        } else if (this.insurancePolicy2.insuranceCheck.recently3YOffpayStatus === '0') {
          return 'alert-warning'
        }
        return ''
      },
      set: function () {

      }
    },
    recentlyYChangePayTypeActive2: {
      get: function () {
        if (this.insurancePolicy2.insuranceCheck.recentlyYChangePayType === '1') {
          return 'alert-success'
        } else if (this.insurancePolicy2.insuranceCheck.recentlyYChangePayType === '0') {
          return 'alert-warning'
        }
        return ''
      },
      set: function () {

      }
    },
    recordFullStatusActive2: {
      get: function () {
        if (this.insurancePolicy2.insuranceCheck.recordFullStatus === '1') {
          return 'alert-success'
        } else if (this.insurancePolicy2.insuranceCheck.recordFullStatus === '0') {
          return 'alert-warning'
        }
        return ''
      },
      set: function () {

      }
    },
    quizStatusActive2: {
      get: function () {
        if (this.insurancePolicy2.insuranceCheck.quizStatus === '1') {
          return 'alert-success'
        } else if (this.insurancePolicy2.insuranceCheck.quizStatus === '0') {
          return 'alert-warning'
        }
        return ''
      },
      set: function () {

      }
    },
    selfPolicyActive2: {
      get: function () {
        if (this.insurancePolicy2.insuranceCheck.selfPolicy === '1') {
          return 'alert-success'
        } else if (this.insurancePolicy2.insuranceCheck.selfPolicy === '0') {
          return 'alert-warning'
        }
        return ''
      },
      set: function () {

      }
    },
    otherQuestionActive2: {
      get: function () {
        if (this.insurancePolicy2.insuranceCheck.otherQuestion === '1') {
          return 'alert-success'
        } else if (this.insurancePolicy2.insuranceCheck.otherQuestion === '0') {
          return 'alert-warning'
        }
        return ''
      },
      set: function () {

      }
    },
    screenCaptureCheckActive3: {
      get: function () {
        if (this.insurancePolicy3.insuranceCheck.screenCaptureCheck === '1') {
          return 'alert-success'
        } else if (this.insurancePolicy3.insuranceCheck.screenCaptureCheck === '0') {
          return 'alert-warning'
        }
        return ''
      },
      set: function () {

      }
    },
    phoneCheckResultActive3: {
      get: function () {
        if (this.insurancePolicy3.insuranceCheck.phoneCheckResult === '1') {
          return 'alert-success'
        } else if (this.insurancePolicy3.insuranceCheck.phoneCheckResult === '0') {
          return 'alert-warning'
        }
        return ''
      },
      set: function () {

      }
    },
    policyDisbursementsStatusActive3: {
      get: function () {
        if (this.insurancePolicy3.insuranceCheck.policyDisbursementsStatus === '1') {
          return 'alert-success'
        } else if (this.insurancePolicy3.insuranceCheck.policyDisbursementsStatus === '0') {
          return 'alert-warning'
        }
        return ''
      },
      set: function () {

      }
    },
    recently3YOffpayStatusActive3: {
      get: function () {
        if (this.insurancePolicy3.insuranceCheck.recently3YOffpayStatus === '1') {
          return 'alert-success'
        } else if (this.insurancePolicy3.insuranceCheck.recently3YOffpayStatus === '0') {
          return 'alert-warning'
        }
        return ''
      },
      set: function () {

      }
    },
    recentlyYChangePayTypeActive3: {
      get: function () {
        if (this.insurancePolicy3.insuranceCheck.recentlyYChangePayType === '1') {
          return 'alert-success'
        } else if (this.insurancePolicy3.insuranceCheck.recentlyYChangePayType === '0') {
          return 'alert-warning'
        }
        return ''
      },
      set: function () {

      }
    },
    recordFullStatusActive3: {
      get: function () {
        if (this.insurancePolicy3.insuranceCheck.recordFullStatus === '1') {
          return 'alert-success'
        } else if (this.insurancePolicy3.insuranceCheck.recordFullStatus === '0') {
          return 'alert-warning'
        }
        return ''
      },
      set: function () {

      }
    },
    quizStatusActive3: {
      get: function () {
        if (this.insurancePolicy3.insuranceCheck.quizStatus === '1') {
          return 'alert-success'
        } else if (this.insurancePolicy3.insuranceCheck.quizStatus === '0') {
          return 'alert-warning'
        }
        return ''
      },
      set: function () {

      }
    },
    selfPolicyActive3: {
      get: function () {
        if (this.insurancePolicy3.insuranceCheck.selfPolicy === '1') {
          return 'alert-success'
        } else if (this.insurancePolicy3.insuranceCheck.selfPolicy === '0') {
          return 'alert-warning'
        }
        return ''
      },
      set: function () {

      }
    },
    otherQuestionActive3: {
      get: function () {
        if (this.insurancePolicy3.insuranceCheck.otherQuestion === '1') {
          return 'alert-success'
        } else if (this.insurancePolicy3.insuranceCheck.otherQuestion === '0') {
          return 'alert-warning'
        }
        return ''
      },
      set: function () {

      }
    }
  },
  mounted () {
    // if(this.estateData && this.estateData.length < 1){
    //     this.addEstateDefaultEmptyRow();
    // }
  },
  created () {
    this.$ajax = this.$util.ajax()
    if (this.taskParams.isLoad) {
      this.initpage()
    }
  },
  watch: {
    // 点击tab页签，加载数据，只加载一次
    'taskParams.loanInfo' (v) {
      if (v) {
        this.initpage()
      }
    }
  },
  props: {
    taskParams: Object
  }
}
</script>

<style>
.alert-success {
  background-color: #edfff3;
}
.alert-warning {
  background-color: #fff9e6;
}
.alert-info {
  background-color: #f0faff;
}
.collapse-panel-title {
  float: right;
  margin-right: 20px;
  font-weight: bold;
}
</style>
